/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package queenb.web.store;

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.faces.model.SelectItem;
import oracle.jdbc.OracleTypes;
import queenb.net.datacontrol.DataStatement;
import queenb.net.datacontrol.Param;
import queenb.net.entitybean.M000;
import queenb.web.util.PackageContants;

/**
 *
 * @author VANANH
 */
public class M000Store extends M000 {

    public List<M000> mcurpks_listoftabm000(int pnFH000, int pnFH200, int pnFM000, String pvLOGIN) throws SQLException, InstantiationException, IllegalAccessException {
        DataStatement dataStatement = new DataStatement(PackageContants.mcurpks_listoftabm000, OracleTypes.CURSOR, new Param[]{
                    new Param(OracleTypes.INTEGER, pnFH000),
                    new Param(OracleTypes.INTEGER, pnFH200),
                    new Param(OracleTypes.INTEGER, pnFM000),
                    new Param(OracleTypes.CHAR, pvLOGIN)
                });

        return super.find(dataStatement, M000.class);
    }

    public List<M000> COMBCURPKS_COMBTABM000(int pnFH000, int pnFH200, String pvLOGIN) throws SQLException, InstantiationException, IllegalAccessException {
        DataStatement dataStatement = new DataStatement(PackageContants.COMBCURPKS_COMBTABM000, OracleTypes.CURSOR, new Param[]{
                    new Param(OracleTypes.INTEGER, pnFH000),
                    new Param(OracleTypes.INTEGER, pnFH200),
                    new Param(OracleTypes.CHAR, pvLOGIN)
                });

        return super.find(dataStatement, M000.class);
    }

    public int stdm_tools_inserttabm000(int pnPM000,int pnFH000,int pnFH200, String pvMV001, String pvMV002,String pvLOGIN) {
        try {
            DataStatement updateStatement = new DataStatement(PackageContants.stdm_tools_inserttabm000, OracleTypes.INTEGER, new Param[]{
                        new Param(OracleTypes.INTEGER, pnPM000),
                           new Param(OracleTypes.INTEGER, pnFH000),
                              new Param(OracleTypes.INTEGER, pnFH200),
                        new Param(OracleTypes.CHAR, pvMV001),
                        new Param(OracleTypes.CHAR, pvMV002),
                        new Param(OracleTypes.CHAR, pvLOGIN)});
            return super.update(updateStatement, M000.class);
        } catch (SQLException ex) {

            return 0;
        }

    }
    public int stdc_tools_stornotabcM000(int pnPM000, String pvLOGIN) {
        try {
            DataStatement dataStatement = new DataStatement(PackageContants.stdm_tools_inserttabm000, OracleTypes.INTEGER, new Param[]{
                        new Param(OracleTypes.INTEGER, pnPM000),
                        new Param(OracleTypes.CHAR, pvLOGIN)
                    });
            return super.update(dataStatement, M000.class);
        } catch (SQLException ex) {
            Logger.getLogger(C350Store.class.getName()).log(Level.SEVERE, null, ex);
            return 0;
        }

    }
  
}
